﻿using System.Web.Mvc;
using EnetaMvc.ApplicationServices;

namespace EnetaMvc.Web.Controllers
{
    public class NewsController : BaseController
    {
        private readonly INewsService _newsService;
        private readonly IContentService _contentService;

        public NewsController(INewsService newsService, IContentService contentService)
        {
            _newsService = newsService;
        }

        public ActionResult Index(int page = 1)
        {
            if (page < 1)
                page = 1;

            var result = _newsService.ListPublishedNewsItems(page, 10);

            return View(result);
        }
    }
}
